package com.ly.mapper;

import com.ly.bean.EasybuyProductCategory;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

/**
@author 李岩
@date 2021/12/14-13:52
@describe
*/
@Mapper
public interface EasybuyProductCategoryMapper {
    /**
     * 根据父级id查询下级分类
     */
    List<EasybuyProductCategory> findCategoryByPid(Integer pid) throws Exception;

    //各种销售商品分类统计的饼状图实现
    List<EasybuyProductCategory> selectSellNameAndValue() throws Exception;

    //月销售额的折线图实现
    Map<String,Double> selectMonthCost(String month) throws Exception;
    /**
     * 根据一级商品的id查询下面所有的三级商品
     */
    List<EasybuyProductCategory> findThirdCategoryByPid(Integer pid) throws Exception;
    /**
     * delete by primary key
     * @param id primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(Integer id) throws Exception;

    /**
     * insert record to table
     * @param record the record
     * @return insert count
     */
    int insert(EasybuyProductCategory record) throws Exception;

    /**
     * insert record to table selective
     * @param record the record
     * @return insert count
     */
    int insertSelective(EasybuyProductCategory record) throws Exception;

    /**
     * select by primary key
     * @param id primary key
     * @return object by primary key
     */
    EasybuyProductCategory selectByPrimaryKey(Integer id) throws Exception;

    /**
     * update record selective
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(EasybuyProductCategory record) throws Exception;

    /**
     * update record
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(EasybuyProductCategory record) throws Exception;
}